import { createApp } from 'vue'
import App from './App.vue'
import './style.css'
import router from './router/router.js'
import ArcoVue from '@arco-design/web-vue'
import ArcoVueIcon from '@arco-design/web-vue/es/icon'
import { createPinia } from 'pinia'
import * as echarts from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { LineChart, BarChart, TreeChart } from 'echarts/charts'
import {
  TitleComponent,
  TooltipComponent,
  GridComponent,
  LegendComponent,
  ToolboxComponent,
  BrushComponent,
  VisualMapComponent,
  DataZoomComponent
} from 'echarts/components'

import '@arco-design/web-vue/dist/arco.css'
import '@/assets/style/index.less'
import 'bootstrap-icons/font/bootstrap-icons.css'
import 'amfe-flexible'

// 把你 option 里用到的所有组件都加到 use 里test
echarts.use([
  CanvasRenderer,
  LineChart,
  BarChart,
  TitleComponent,
  TooltipComponent,
  GridComponent,
  LegendComponent,
  ToolboxComponent,
  BrushComponent,
  VisualMapComponent,
  DataZoomComponent,
  TreeChart
])
const pinia = createPinia()

const app = createApp(App)
app.config.globalProperties.$echarts = echarts
app.use(router)
app.use(ArcoVue)
app.use(pinia)
app.use(ArcoVueIcon)
app.mount('#app')
